<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title></title>
  <link rel="stylesheet" type="text/css" href="assets/css/bootstrap.min.css">
</head>
<body>
<?php
   $row = $data['users'];
   //var_dump($row); 
   $id = $row['uid'];  
   $uname = $row['uname'];
   $gender = $row['gender'];
   $birthdate = $row['birthdate'];
   $hobby = $row['hobby'];
   $degree = $row['degree'];
   $intro = $row['intro'];
   $pic = 'upload/'.$row['pic'];    
  //将查询结果显示在表单中
 ?>

<form method="post"  action="admin.php?c=user&m=update"  enctype="multipart/form-data" class="form-horizontal" >

<h1 align="center" style="margin-right:20px">修改用户信息</h1>
<div class="container-fluid col-md-12">  

<div class="form-group">
  <label for="foodname" class="col-md-4 control-label">姓名：</label>
  <div class="col-sm-4"><input class="form-control" type="text" name="uname" size=30  value=<?php  echo $uname;  ?>></div>
</div>

<div class="form-group">
<label for="foodname" class="col-md-4 control-label">性别:</label>
<div class="col-sm-4">
<input type="radio" name="gender" value="0" <?php  if(!$gender) echo 'checked';  ?>>男
<input type="radio" name="gender" value="1" <?php  if($gender) echo 'checked';  ?>>女</div>
</div>

<div class="form-group">
  <label for="foodname" class="col-md-4 control-label">生日：</label>
  <div class="col-sm-4"><input class="form-control" type="date" name="birthdate"  size=30 value=<?php  echo $birthdate;  ?>></div>
</div>

<div class="form-group">
<label for="foodname" class="col-md-4 control-label">爱好：</label>
<div class="col-sm-4">
     <input type="checkbox" name="hobby[]" value="旅游" <?php  if(strstr($hobby,'旅游')) echo 'checked';  ?>>旅游
     <input type="checkbox" name="hobby[]" value="登山" <?php  if(strstr($hobby,'登山')) echo 'checked';  ?>>登山
     <input type="checkbox" name="hobby[]" value="健身" <?php  if(strstr($hobby,'健身')) echo 'checked';  ?>>健身
     <input type="checkbox" name="hobby[]" value="上网" <?php  if(strstr($hobby,'上网')) echo 'checked';  ?>>上网
     <input type="checkbox" name="hobby[]" value="游泳" <?php  if(strstr($hobby,'游泳')) echo 'checked';  ?>>游泳
</div>
</div>

<div class="form-group">
<label for="foodname" class="col-md-4 control-label">学历:</label>
<div class="col-sm-4">
<select  class="form-control" name="degree">
  <option value="0">---请选择---</option>
  <option value="1" <?php  if($degree=='1') echo 'selected';  ?>>高中</option>
  <option value="2" <?php  if($degree=='2') echo 'selected';  ?>>大学</option>
  <option value="3" <?php  if($degree=='3') echo 'selected';  ?>>研究生</option>
  <option value="4" <?php  if($degree=='4') echo 'selected';  ?>>博士生</option>
      </select>
</div>
</div>

<div class="form-group">
<label for="foodname" class="col-md-4 control-label">自我介绍：</label>
<div class="col-sm-4">
<textarea  class="form-control" name="intro" cols="40" rows="5"><?php  echo $intro;  ?></textarea>
</div>
</div>

<div class="form-group">
  <label for="exampleInputFile" class="col-md-4 control-label">头像:</label>
  <div class="col-sm-4">
    <img src='<?php echo $pic; ?>' width=150 height=150 class="img-circle">
    <input type="file" name="pic" id="exampleInputFile">
  </div>
</div>

  <div class="form-group">
      <div class="col-sm-offset-4 col-sm-6">
          <input type="submit" class="btn btn-success" value="提交">
          <input type="reset" class="btn btn-primary" value="重置">
      </div>
  </div>
</div>
</form>
</body>
</html>